/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ResourceManager;
import GameObject.*;
import GameCore.*;

/**
 *
 * @author NGUYEN VAN TAM
 */
public class CardManager extends EntityManager
{
    @Override
    public void InitPrototype()
    {
        _nprototype = ResourceSetting.Card_nCard;
        _prototype = new Card[_nprototype];

        for (int i = 0; i < _nprototype; i++)
        {
            _prototype[i] = new Card();
            ((Card)_prototype[i]).Init(ResourceSetting.CardSprite(i),ResourceSetting.Card_Width,ResourceSetting.Card_Height, ResourceSetting.CardStrResource(i), ResourceSetting.Card_iSprite, ResourceSetting.Card_nDelay);
        }
    }
    
    @Override
    public VisibleGameObject CreateObject(int index)
    {
        if ((index < 0) || (index >= _nprototype))
        {
            return null;
        }
        return _prototype[index].Clone();
    }
}
